package com.example.kotlinlearndemo.kotlin

import com.example.kotlinlearndemo.kotlin.interfaceexample.InterfaceExample1

typealias Predicate<T> = (T) -> Boolean

fun foo(p: Predicate<Int>) = p(42)

fun main() {
    val f: (Int) -> Boolean = { it > 0 }
    println(foo(f)) // prints "true"

    val p: Predicate<Int> = { it > 0 }
    println(listOf(1, -2).filter(p)) // prints "[1]"

    val example1 = InterfaceExample1()
    example1.booS(1) { p ->
        p > 0
    }
}